<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .content{
            width: 200px;
            height: 200px;
            background-color: cornsilk;
        }
        .html-contents{
            background-color: crimson;
        }
        .css-contents{
            background-color: rgb(83, 220, 20);
        }.js-contents{
            background-color: rgb(20, 107, 220);
        }.vuejs-contents{
            background-color: rgb(220, 20, 210);
        }
    </style>
</head>
<body>
    <div id="app">
        <button v-for='(item,idx) in title'   v-on:click='handler(idx)'>{{item.item}}</button>
        <div class="content" v-bind:class='act'>{{act}}</div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        let vm = new Vue({
            el:'#app',
            data:{
                num:0,
                title:[
                    {item:'html'},
                    {item:'css'},
                    {item:'js'},
                    {item:'vuejs'}
                ],
                contents:[
                    {item:'html-contents'},
                    {item:'css-contents'},
                    {item:'js-contents'},
                    {item:'vuejs-contents'}
                ]
            },
            methods: {
                handler(data){
                    this.num=data
                }
            },
            computed: {
                act(){
                    return this.contents[this.num].item
                }
            }
        })
    </script>
</body>
</html>